// 1.引入Vue  Vuex
import Vue from "vue"
import Vuex from "vuex"

//2.安装插件
Vue.use(Vuex)

//类似于 methods
import mutations from "./mutations/mutations"
//类似于 computed
import getters from "./getters/getters"
//异步请求
import actions from "./actions/actions"

const state = {
  //存放所有数据
  totalData: [],
  menu: {
    activeName: '1-1',
    openNames: ['1'],
  },
  user:null
}

//3. 创建对象
const store = new Vuex.Store({
  state:state,
  mutations,
  getters,
  actions
})


// 4.导出store对象
export default store





